home *** CD-ROM | disk | FTP | other *** search
- unit TCInetTool;
-
- interface
-
- uses
- Windows, oleauto, ActiveX, Graphics, Sysutils, AXCtrls, ComObj, InetTool_TLB, IMSIGX_TLB;
-
- type
- TTCInetTool = class(TAutoObject, ITCInetTool)
- protected
- function Get_Description: WideString; stdcall;
- function GetToolInfo(var CommandNames, MenuCaptions, StatusPrompts,
- Tooltips, Enabled, WantsUpdate: OleVariant): Integer; stdcall;
- function GetPicture(var LargeImage, MonoImage: WordBool): IPictureDisp;
- stdcall;
- function Initialize(var Tool: IDispatch): WordBool; stdcall;
- function Run(var Tool: IDispatch): WordBool; stdcall;
- function UpdateToolStatus(var Tool: IDispatch; var Enabled,
- Checked: WordBool): WordBool; stdcall;
- {Declare ITCInetTool methods here}
- end;
-
- implementation
-
- uses ComServ;
-
- //'Number of tools in this server
- Const NUM_TOOLS = 1;
-
- //'Toggle this to test loading buttons from .Bmp/.Res
- Const boolLoadFromBmp = False;
- Const boolDebug = False;
-
- function TTCInetTool.Get_Description: WideString;
- begin
- Get_Description := 'Internet connection tool';
- end;
-
- function TTCInetTool.GetToolInfo(var CommandNames, MenuCaptions,
- StatusPrompts, Tooltips, Enabled, WantsUpdate: OleVariant): Integer;
- begin
- VarArrayRedim(CommandNames, NUM_TOOLS);
- VarArrayRedim(MenuCaptions, NUM_TOOLS);
- VarArrayRedim(StatusPrompts, NUM_TOOLS);
- VarArrayRedim(ToolTips, NUM_TOOLS);
- VarArrayRedim(Enabled, NUM_TOOLS);
- VarArrayRedim(WantsUpdate, NUM_TOOLS);
- CommandNames[0]:= 'SDK|Internet|Hyperlink';
- MenuCaptions[0] := '&Hyperlink';
- StatusPrompts[0] := 'Launch a browser on the World Wide Web';
- ToolTips[0] := 'Hyperlink';
- Enabled[0] := True;
- WantsUpdate[0] := False;
-
- GetToolInfo := NUM_TOOLS;
-
- end;
-
- function TTCInetTool.GetPicture(var LargeImage,
- MonoImage: WordBool): IPictureDisp;
- Var pTBmp: TBitMap;
-
- begin
-
-
- end;
-
- function TTCInetTool.Initialize(var Tool: IDispatch): WordBool;
- begin
- Initialize := true;
- end;
-
- function TTCInetTool.Run(var Tool: IDispatch): WordBool;
- begin
-
- // Add your code here
- MessageBox(0, 'Add your code here', 'TurboCAD SDK tool', IDOK );
- Result := true
- end;
-
- function TTCInetTool.UpdateToolStatus(var Tool: IDispatch; var Enabled,
- Checked: WordBool): WordBool;
- begin
- Enabled := True; //'Could do a test here to determine whether to disable the button/menu item
- Checked := False; // 'Could do a test here to determine whether to check the button/menu item
- UpdateToolStatus := True;
- end;
-
- initialization
- TAutoObjectFactory.Create(ComServer, TTCInetTool, Class_TCInetTool,
- ciMultiInstance, tmSingle);
- end.
-